import React, {
  Component,
  createRef,
  createContext,
  useRef,
  useState,
} from "react";
import PropType from 'prop-types'
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
//  react 跨多级组件传递参数
const { Provider, Consumer } = createContext({});

type listT ={
  list:Array<number>
}

const Test = (props:listT) => {
  const {list} = props
   
  return (
    <>
   <div>xzc </div>
  {list.map((item:any)=><span key={item}>{item}</span>)}
   </>
  );
};
Test.propType ={
    list:PropType.array
}


class ReactDemo extends React.Component {
  

  render(): React.ReactNode {
    return (
      <>
       
        <div>嘻嘻嘻</div>
      <Test list={[1,2,3]} />
      </>
    );
  }
}

export default ReactDemo;
